package com.ngo100.demo.jna;

import com.sun.jna.Structure;

import java.util.Arrays;
import java.util.List;

public class IDCardInfo extends Structure {
    // 严格按照文档属性定义
    public byte[] Name = new byte[60];          // 姓名，60字节
    public byte[] Gender = new byte[4];         // 性别，4字节
    public byte[] Nation = new byte[48];        // 民族，48字节
    public byte[] BirthDate = new byte[18];     // 出生日期，18字节
    public byte[] Address = new byte[140];      // 地址，140字节
    public byte[] IDCardNo = new byte[36];      // 身份证号，36字节
    public byte[] GrantDept = new byte[64];     // 签发机关，64字节
    public byte[] EffDate = new byte[18];       // 有效起始日期，18字节
    public byte[] ExpDate = new byte[18];       // 有效截止日期，18字节
    public byte[] Ename = new byte[64];         // 英文姓名
    public byte[] CertType = new byte[2];       // 证件类型标识
    public byte[] CardVer = new byte[4];        // 证件版本号
    public byte[] PassNo = new byte[32];        // 通行证号码
    public byte[] IssueTimes = new byte[4];     // 签发次数
    public byte[] AppendMsg = new byte[128];    // 新地址
    public byte[] GenderCode = new byte[2];     // 性别代码
    public byte[] NationCode = new byte[4];     // 民族代码
    public byte[] GrantDeptCode = new byte[16]; // 签发机关代码
    public byte[] PhotoFileName = new byte[256];// 照片路径
    public byte[] CardInfo = new byte[512];     // 身份证文字原始信息
    public byte[] FingerInfo = new byte[1024];  // 指纹原始信息
    public byte[] SAMID = new byte[32];         // SAMID号
    public byte[] DN = new byte[128];           // 身份证DN码
    public byte[] ImgBase64 = new byte[8192]; // 照片Base64数据流

    @Override
    protected List<String> getFieldOrder() {
        return Arrays.asList(
                "Name", "Gender", "Nation", "BirthDate", "Address", "IDCardNo",
                "GrantDept", "EffDate", "ExpDate", "Ename", "CertType", "CardVer",
                "PassNo", "IssueTimes", "AppendMsg", "GenderCode", "NationCode",
                "GrantDeptCode", "PhotoFileName", "CardInfo", "FingerInfo", "SAMID",
                "DN", "ImgBase64"
        );
    }
}
